#include<iostream>
using namespace std;
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		int cnt = 0;
		while (n) {
			cnt += n % 2;
			n /= 2;
		}
		if (cnt == 1)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}